package com.wang.controller;

import com.wang.service.CategoryService;
import com.wang.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping ("/category/{offset}/{size}/{categoryId}")
    public Result category(@PathVariable("offset") int offset,@PathVariable("size") int size,@PathVariable("categoryId") Long categoryId) {
        return categoryService.ArticleListByCategoryId(offset, size,categoryId);
    }
}
